﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NPMonitor.Interfaces;
using NPMonitor.DataModel;

namespace NPMonitor.Implementation.Internal
{
    internal class WorkflowJobExecutor : DefaultJobExecutor
    {
        protected override List<JobInstance> GetExecuteJobList(AppDomain domain)
        {
            List<JobInstance> list = new List<JobInstance>();

            List<WorkflowJobData> wfJobList = StoreManager.Current.WorkflowStore.GetWorkflowJobDataByWorkflowId(jobData.TaskId.Value);

            foreach (var wfJob in wfJobList)
            {
                JobInstance job = new JobInstance()
                {
                    Job = JobFileLoader.NewJobInstance(domain, wfJob.JobId),
                    WorkflowJob = wfJob
                };

                list.Add(job);
            }

            return list;
        }
    }
}
